databaseChangeLog = {

	changeSet(author: "mark (generated)", id: "1358527449627-1") {
		createTable(tableName: "label") {
			column(autoIncrement: "true", name: "id", type: "bigint") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "labelPK")
			}

			column(name: "version", type: "bigint") {
				constraints(nullable: "false")
			}

			column(name: "assigned", type: "bit") {
				constraints(nullable: "false")
			}

			column(name: "created_by_user_name", type: "varchar(255)") {
				constraints(nullable: "false")
			}

			column(name: "creation_date", type: "datetime") {
				constraints(nullable: "false")
			}

			column(name: "registered_to_id", type: "bigint")

			column(name: "registration_date", type: "datetime")

			column(name: "serial_number", type: "integer") {
				constraints(nullable: "false")
			}

			column(name: "type", type: "varchar(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-2") {
		createTable(tableName: "labeled_item") {
			column(autoIncrement: "true", name: "id", type: "bigint") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "labeled_itemPK")
			}

			column(name: "version", type: "bigint") {
				constraints(nullable: "false")
			}

			column(name: "description", type: "varchar(255)") {
				constraints(nullable: "false")
			}

			column(name: "label_id", type: "bigint") {
				constraints(nullable: "false")
			}

			column(name: "name", type: "varchar(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-3") {
		createTable(tableName: "registration_code") {
			column(autoIncrement: "true", name: "id", type: "bigint") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "registration_PK")
			}

			column(name: "date_created", type: "datetime") {
				constraints(nullable: "false")
			}

			column(name: "token", type: "varchar(255)") {
				constraints(nullable: "false")
			}

			column(name: "username", type: "varchar(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-4") {
		createTable(tableName: "sec_role") {
			column(autoIncrement: "true", name: "id", type: "bigint") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "sec_rolePK")
			}

			column(name: "version", type: "bigint") {
				constraints(nullable: "false")
			}

			column(name: "authority", type: "varchar(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-5") {
		createTable(tableName: "sec_user") {
			column(autoIncrement: "true", name: "id", type: "bigint") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "sec_userPK")
			}

			column(name: "version", type: "bigint") {
				constraints(nullable: "false")
			}

			column(name: "account_expired", type: "bit") {
				constraints(nullable: "false")
			}

			column(name: "account_locked", type: "bit") {
				constraints(nullable: "false")
			}

			column(name: "enabled", type: "bit") {
				constraints(nullable: "false")
			}

			column(name: "password", type: "varchar(255)") {
				constraints(nullable: "false")
			}

			column(name: "password_expired", type: "bit") {
				constraints(nullable: "false")
			}

			column(name: "username", type: "varchar(255)") {
				constraints(nullable: "false")
			}

			column(name: "class", type: "varchar(255)") {
				constraints(nullable: "false")
			}

			column(name: "contact_cell_phone", type: "varchar(255)")

			column(name: "contactemail", type: "varchar(255)")

			column(name: "contact_other_phone", type: "varchar(255)")

			column(name: "contact_skype_id", type: "varchar(255)")

			column(name: "create_time", type: "datetime")

			column(name: "first_name", type: "varchar(255)")

			column(name: "last_name", type: "varchar(255)")

			column(name: "mailing_address_address1", type: "varchar(255)")

			column(name: "mailing_address_address2", type: "varchar(255)")

			column(name: "mailing_address_city", type: "varchar(255)")

			column(name: "mailing_address_country", type: "varchar(2)")

			column(name: "mailing_address_state", type: "varchar(2)")

			column(name: "mailing_address_zip_code", type: "varchar(255)")
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-6") {
		createTable(tableName: "sec_user_sec_role") {
			column(name: "sec_role_id", type: "bigint") {
				constraints(nullable: "false")
			}

			column(name: "sec_user_id", type: "bigint") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-7") {
		addPrimaryKey(columnNames: "sec_role_id, sec_user_id", constraintName: "sec_user_sec_PK", tableName: "sec_user_sec_role")
	}

	changeSet(author: "mark (generated)", id: "1358527449627-8") {
		addForeignKeyConstraint(baseColumnNames: "registered_to_id", baseTableName: "label", constraintName: "FK61F7EF4F0A3AC8B", deferrable: "false", initiallyDeferred: "false", referencedColumnNames: "id", referencedTableName: "sec_user", referencesUniqueColumn: "false")
	}

	changeSet(author: "mark (generated)", id: "1358527449627-9") {
		addForeignKeyConstraint(baseColumnNames: "label_id", baseTableName: "labeled_item", constraintName: "FKE9BB93FD6CE1603", deferrable: "false", initiallyDeferred: "false", referencedColumnNames: "id", referencedTableName: "label", referencesUniqueColumn: "false")
	}

	changeSet(author: "mark (generated)", id: "1358527449627-10") {
		addForeignKeyConstraint(baseColumnNames: "sec_role_id", baseTableName: "sec_user_sec_role", constraintName: "FK6630E2AF6D558AC", deferrable: "false", initiallyDeferred: "false", referencedColumnNames: "id", referencedTableName: "sec_role", referencesUniqueColumn: "false")
	}

	changeSet(author: "mark (generated)", id: "1358527449627-11") {
		addForeignKeyConstraint(baseColumnNames: "sec_user_id", baseTableName: "sec_user_sec_role", constraintName: "FK6630E2A9C001C8C", deferrable: "false", initiallyDeferred: "false", referencedColumnNames: "id", referencedTableName: "sec_user", referencesUniqueColumn: "false")
	}

	changeSet(author: "mark (generated)", id: "1358527449627-12") {
		createIndex(indexName: "FK61F7EF4F0A3AC8B", tableName: "label") {
			column(name: "registered_to_id")
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-13") {
		createIndex(indexName: "FKE9BB93FD6CE1603", tableName: "labeled_item") {
			column(name: "label_id")
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-14") {
		createIndex(indexName: "authority_unique_1358527449563", tableName: "sec_role", unique: "true") {
			column(name: "authority")
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-15") {
		createIndex(indexName: "contactemail_unique_1358527449570", tableName: "sec_user", unique: "true") {
			column(name: "contactemail")
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-16") {
		createIndex(indexName: "username_unique_1358527449569", tableName: "sec_user", unique: "true") {
			column(name: "username")
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-17") {
		createIndex(indexName: "FK6630E2A9C001C8C", tableName: "sec_user_sec_role") {
			column(name: "sec_user_id")
		}
	}

	changeSet(author: "mark (generated)", id: "1358527449627-18") {
		createIndex(indexName: "FK6630E2AF6D558AC", tableName: "sec_user_sec_role") {
			column(name: "sec_role_id")
		}
	}

	include file: 'found-flow.groovy'

	include file: 'found-flow1.groovy'

	include file: 'found-flow2.groovy'

	include file: 'lost-flow.groovy'
}
